<?php
use common\service\StaticService;
use common\service\GlobalUrlService;
use shopend\assets\ShopAsset;
StaticService::includeAppJsStatic(GlobalUrlService::buildShopStaticUrl('/backend/goods/indexs.js'),ShopAsset::class);
?>

<div class="layui-card">
  <div class="layui-card-header">商品列表</div>
  <div class="layui-card-body">
    <form method="get" class="layui-form" id="serch-form">
      名称:
      <div class="layui-inline">
        <input type="text"  name="goods_name" class="layui-input"  value="" />
      </div>
      商品分类:
      <div class="layui-inline">
        <select class="oneclass" name="tree_id" lay-filter="one">
          <option value="0">请选择一级分类</option>
          <?php foreach ($trees as $val):?>
            <option value="<?=$val['id']?>"><?=$val['tree_name']?></option>
          <?php endforeach;?>
        </select>
      </div>
      <div class="layui-inline">
        <select class="twoclass" name="two_id" lay-filter="two"></select>
      </div>
      <div class="layui-inline">
        <select class="threeclass" name="three_id"></select>
      </div>
      <div class="layui-inline">
        <button class="layui-btn" lay-submit lay-filter="serch-form"><i class="layui-icon">&#xe615;</i>搜索</button>
        <a href="<?= GlobalUrlService::buildShopUrl('goods/add')?>" class="layui-btn layui-btn-normal"><i class="layui-icon">&#xe61f;</i>添加商品</a>
      </div>
    </form>
    <table class="layui-hide" id="test"  lay-filter="barDemo"></table>
    <script type="text/html" id="img">
      <img src="{{d.avatarurl}}"/>
    </script>
    <script type="text/html" id="barDemo">
      <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
     {{# if(d.status == 0){ }}
     <a class="layui-btn layui-btn-xs" lay-event="up">上架</a>
     {{# }else if(d.status == 1){ }}
     <a class="layui-btn layui-btn-xs" lay-event="down">下架</a>
     {{# } }}
     <a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="del">删除</a>
   </script>
   <script type="text/html" id="SKU">
    <a class="layui-btn layui-btn-xs" lay-event="sku">查看商品SKU</a>
  </script>
</div>
</div>
